package edu.unlv.cs.ladders.entities;

import edu.unlv.cs.ladders.entities.UserRole;
import java.lang.Long;
import java.util.List;

privileged aspect UserRole_Roo_Entity {
    
    public static long UserRole.countUserRoles() {
        return (Long) entityManager().createQuery("select count(o) from UserRole o").getSingleResult();
    }
    
    public static List<UserRole> UserRole.findAllUserRoles() {
        return entityManager().createQuery("select o from UserRole o").getResultList();
    }
    
    public static UserRole UserRole.findUserRole(Long id) {
        if (id == null) return null;
        return entityManager().find(UserRole.class, id);
    }
    
    public static List<UserRole> UserRole.findUserRoleEntries(int firstResult, int maxResults) {
        return entityManager().createQuery("select o from UserRole o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
    }
    
}
